#pragma once

#include <vector>

#include "utils.h"

struct Pass {
    virtual void* Run(void* input) = 0;
};

struct PassManager {
    std::vector<Pass*> passes;

    template <class T, class... Args>
    void AddPass(Args&&... args) {
        passes.emplace_back(new T(args...));
    }

    void* Run(void* input) {
        for (auto pass : passes) {
            void* output = pass->Run(input);
            input = output;
        }
        return input;
    }
};
